package com.lsh.controller;

import com.lsh.pojo.Result;
import com.lsh.pojo.student;
import com.lsh.service.StuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@CrossOrigin
@RequestMapping("/stu-management")
public class LoginController {

    @Autowired
    private StuService stuService;

    @PostMapping("/login")
    public Result login(@RequestBody student stu) {
//        log.info("登入的信息为：{}",stu);
        student s = stuService.login(stu);
        if(s == null) {
            return Result.error("账号或密码错误！");
        }
        return Result.success();
    }

}
